<template>
  <div class="home-banner">
    <!-- 轮播图 -->
    <!-- sliders: 控制轮播图需要渲染的数据 -->
    <!-- duration :如果要自动播放，每隔3秒钟会自动换一张图 -->
    <!-- autoPlay: 控制轮播图是否自动播放 -->
    <XtxCarousel :sliders="sliders"></XtxCarousel>
  </div>
</template>
<script>
import { ref } from 'vue'
import { findBanner } from '@/api/home'
export default {
  name: 'HomeBanner',
  setup() {
    const sliders = ref([])
    findBanner().then(res => {
      sliders.value = res.result
      // console.log(res)
    })
    return {
      sliders
    }
  }
}
</script>
<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
  // background-color: pink;
  :deep(.prev) {
    left: 270px !important;
  }
  :deep(.carousel-indicator) {
    padding-left: 250px;
  }
}
</style>
